﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
using FineUI;
using WebApplication1.MSG;

namespace WebApplication1
{
    public partial class Set_EGN : PageBase
    {
        static string flag;
        static int selectedRowIndex;
        static DataTable dt;
        protected void Page_Load(object sender, EventArgs e)
        {
            flag = Request["flag"];

            if (!IsPostBack)
            {


                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();

                DBS me = new DBS();
                dt = me.EGN_List().Tables[0];

                select1.DataSource = dt;
                select1.DataValueField = "ID";
                select1.DataTextField = "ChineseName";
                select1.DataBind();
            }

           
           
 
            
        }
      

      

        protected void Button1_Click1(object sender, EventArgs e)
        {


            DBS me = new DBS();

            me.Change_Task_HSPEGN(flag, select1.Value.ToString());
            SendMSG sd = new SendMSG();
            string rs = sd.Send(dt.Rows[select1.SelectedIndex][2].ToString().Trim(), "收到新任务，请查看！");
           
            Response.Redirect((String)ViewState["UrlReferrer"]);
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            selectedRowIndex = select1.SelectedIndex;
        }
       
    }
}